package com.lbloca.locate.ui.activity;

import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;

import androidx.appcompat.widget.Toolbar;

import com.gyf.immersionbar.ImmersionBar;
import com.lbloca.locate.R;
import com.lbloca.locate.ui.base.BaseActivity;

import butterknife.BindView;

public class EmptyActivity extends BaseActivity {
    @BindView(R.id.id_toolbar)
    Toolbar mToolbar;
    @BindView(R.id.id_tv_name)
    TextView mTvName;

    private static final String sTitleName = "titleNmae";

    @Override
    protected int getLayoutId() {
        return R.layout.activity_empty_page;
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initData() {
       String titleName = getIntent().getStringExtra(sTitleName);
       if(!TextUtils.isEmpty(titleName)){
           mTvName.setText(titleName);
       }
    }

    @Override
    protected void initEvents() {
        mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }

    @Override
    protected void initImmersionBar() {
        super.initImmersionBar();
        ImmersionBar.with(this)
                .statusBarDarkFont(true)
                .navigationBarDarkIcon(true)
                .titleBar(mToolbar)
                .init();
    }

    public static void start(Context context,String name){
        Intent intent = new Intent(context,EmptyActivity.class);
        intent.putExtra(sTitleName,name);
        context.startActivity(intent);
    }
}
